<include file="layout/header" />
	
<div __IMG__/nt">

	<!-- Bread crumb is created dynamically -->
	<!-- row -->
	<div class="row">
	
		<!-- col -->
		<div class="col-xs-12 col-sm-7 col-md-7 col-lg-4">
			<h1 class="page-title txt-color-blueDark"><!-- PAGE HEADER --></h1>
		</div>
		<!-- end col -->
	
	</div>
	<!-- end row -->
	
	<!-- row -->
	
	<div class="row">
	
		<div class="col-sm-12">
	
	
				<div class="well well-sm">
	
					<div class="row">
	
						<div class="col-sm-12 col-md-12 col-lg-6">
							<div class="well well-light well-sm no-margin no-padding">
	
								<div class="row">
	
									<div class="col-sm-12">
	
										<div class="row">
	
											<div class="col-sm-3 profile-pic">
												<img src="{{$data['photo']}}">
												<div class="padding-10">
													<h4 class="font-md">
													<if condition="$data['note']['sex'] == 1">
															<strong class="txt-color-blue">男</strong>
														<else/>
															<strong class="txt-color-pinkDark">女</strong>
														</if>
													<br>
													<small>{{$data.t1|date='Y-m-d',###}}</small></h4>
												</div>
											</div>
											<div class="col-sm-6">
												<h1>{{$data.name}}</span>
												<br>
												<small>{{$data.role}}</small></h1>
	
												<ul class="list-unstyled">
													<li>
														<p class="text-muted">
															<i class="fa fa-phone"></i>&nbsp;&nbsp;<span class="txt-color-blue">{{$data.phone}}</span>
														</p>
													</li>
													<li>
														<p class="text-muted">
															<i class="fa fa-envelope"></i>&nbsp;&nbsp;<span class="txt-color-blue">{{$data.email}}</span>
														</p>
													</li>
													<li>
														<p class="text-muted">
															<i class="fa fa-key"></i>&nbsp;&nbsp;(<span class="txt-color-orangeDark">工牌</span>)  <span class="txt-color-darken">{{$data.note.wcard}}</span>
														</p>
													</li>
													<li>
														<p class="text-muted">
															<i class="fa fa-credit-card"></i>&nbsp;&nbsp;(<span class="txt-color-orangeDark">身份证</span>)  <span class="txt-color-darken">{{$data.note.idcode}}</span>
														</p>
													</li>
													<li>
														<p class="text-muted">
															<i class="fa fa-home"></i>&nbsp;&nbsp;<span class="txt-color-darken">{{$data.addres}}</span>
														</p>
													</li>
												</ul>
										
	
											</div>
											<div class="col-sm-3">
												<h1><small>证件照</small></h1>
												<ul class="list-inline friends-list" id="certificate">
													<foreach name="data.note" item="v" key="k">
														<in name="k" value="id_just,id_back,contract_1,contract_2,contract_3,cert_4,cert_d,cert_z,cert_l,cert_2,cert_3,license_1,license_2">
															<li style="cursor: pointer;"><img src="{{$v}}" alt="<switch name="k">
															<case value='id_just'>身份证正面</case>
															<case value='id_back'>身份证反面</case>
															<case value='contract_1'>合作伙伴合约</case>
															<case value='contract_2'>代理商合约</case>
															<case value='contract_3'>外包工程商合约</case>
															<case value='cert_4'>外部工程师证书</case>
															<case value='cert_d'>单体工程师证书</case>
															<case value='cert_z'>中央工程师证书</case>
															<case value='cert_l'>冷库工程师证书</case>
															<case value='cert_2'>技术人员证书</case>
															<case value='cert_3'>维保人员证书</case>
															<case value='license_1'>外包工程商营业执照</case>
															<case value='license_2'>代理商营业执照</case>
														</switch>"></li>
														</in>
													</foreach>
												</ul>
	
												<!-- <h1><small>审核资源人</small></h1>
												<ul class="list-inline friends-list">
													<li><img src="__IMG__/avatars/male.png" alt="friend-1">
													</li>
													<li><img src="__IMG__/avatars/female.png" alt="friend-2">
													</li>
													<li><img src="__IMG__/avatars/female.png" alt="friend-3">
													</li>
												</ul> -->
	
											</div>
	
										</div>
	
									</div>
	
								</div>
	
								<div class="row">
	
									<div class="col-sm-12">
	
										<hr>
	
										<div class="padding-10">
	
											<ul class="nav nav-tabs tabs-pull-right">
												<li class="active">
													<a href="#a1" data-toggle="tab">资源人审核</a>
												</li>
												<li>
													<a href="#a2" data-toggle="tab">我的资源人</a>
												</li>
												<li class="pull-left">
													<span class="margin-top-10 display-inline"><i class="fa fa-rss text-success"></i> 资源人</span>
												</li>
											</ul>
	
											<div class="tab-content padding-top-10">
												<div class="tab-pane fade in active" id="a1">
													<div class="row">
														<div class="widget-body smart-form">

															<ul class="todo ui-sortable">
																<foreach name="mans" item="v" key="k" >
																	<eq name="v.auth" value="0">
																		<li>
																			<strong>{{$k}}</strong>
																			<p class="col-sm-12" data-uid="{{$v.uid}}" data-rid="{{$v.rid}}" data-tel="{{$v.tel}}" data-ctime="{{$v.ctime}}">
																				<strong>{{$v.name}}</strong> - 申请成为你的资源人 
																				<small class="txt-color-pink">(<eq name="v.rid" value="51">匿名<else/>公开</eq>)</small> 
																				<a href="javascript:void(0);" class="font-xs pass">通过</a> 
																				<a href="javascript:void(0);" class="font-xs refuse">拒绝</a> 
																				<span class="date">{{$v.ctime|date='Y-m-d H:i:s',###}}</span>
																			</p>
																		</li>
																	</eq>
																</foreach>
															</ul>

														</div>
													</div>
												</div>

												<div class="tab-pane fade" id="a2">
	
													<volist name="mans" id="v">
														<eq name="v.auth" value="1">
															<div class="user">
																<if condition="$v['photo']">
																	<img src="{{$v.photo}}">
																<else/>
																	<img src="__IMG__/avatars/female.png">
																</if>
																<a href="javascript:void(0);">{{$v.name}}</a>
																<div class="email">
																	{{$v.phone}}
																</div>
															</div>
														</eq>
													</volist>
													
	
												</div><!-- end tab -->
											</div>
	
										</div>
	
									</div>
	
								</div>
								<!-- end row -->
	
							</div>
	
						</div>
					</div>
	
				</div>
	
	
		</div>
	
	</div>
	
	<!-- end row -->

</div>

<script src="__JS__/layer/layer.js"></script>
<script>
	layer.photos({
		photos: '#certificate',
	    anim: 5 //0-6的选择，指定弹出图片动画类型，默认随机
	});

	$('.font-xs').click(function () {
		var obj = $(this).parent(),
			auth = $(this).attr('class').indexOf('pass') !== -1 ? 1 : 2;

		var data = {
			auth : auth,
			uid : obj.attr('data-uid'),
			rid : obj.attr('data-rid'),
			tel : obj.attr('data-tel'),
			ctime : obj.attr('data-ctime')
		};

		var prompt = auth === 1 ? '确认通过？' : '确认拒绝?';

		layer.confirm(prompt, {
  			btn: ['是','否'] //按钮
		}, function(){
			$.post("{{:url('User/review_resource_man')}}", data, function (res) {
				if (res.status) {
					layer.msg(res.message, {icon: 1});
					obj.parents('li').fadeOut('slow');
				} else {
					layer.msg(res.message, {icon: 2});
				}
			}, 'json');
			
		}, function(){
  			return;
		});

	});

</script>
<include file="layout/footer" />